<?php 
session_cache_expire(999999999);
if(!isset($_SESSION)) 
{ 
	session_start(); 
}
if(isset($_REQUEST['vitri']) && isset($_REQUEST['idnf']) && isset($_REQUEST['titlecomment'])){
	$vitri=$_REQUEST['vitri'];
	$idnf= $_REQUEST['idnf'];
	$titlecomment=addslashes($_REQUEST['titlecomment']);
	$lang = $_SESSION['lang'];
	$username = $_SESSION['fullname'];
	$id_employee = $_SESSION['IDEmployee'];
	if (empty($lang) || $lang == "EN") {
		include '../../value/value_en.php';
	} else if($lang == "VN") {
		include '../../value/value_vn.php';
	}
	else {
		include '../../value/value_kr.php';
	}
	include 'nf_objnewfeature.php';
	if(isset($_SESSION['listnewfeature'][$vitri])){
		$obj= new nf_newfeature();
		$obj=unserialize (serialize($_SESSION['listnewfeature'][$vitri]));
		$sin="insert into pr_newfunction_comment (nfid_comment,nfid_newfunction,nf_contentcomment,nf_datecomment,nf_employee,nf_employee_name) value ('".$_SERVER['REQUEST_TIME']."','".$obj->nfid."','".nl2br($titlecomment)."',now(),'".$id_employee."','".$username."')";
		include '../../operations/connection.php';
		mysql_query($sin);
		$sql="SELECT nfc.nfid_comment,nfc.nf_contentcomment,nfc.nf_datecomment,nfc.nf_employee,nfc.nf_employee_name from pr_newfunction_comment nfc where nfc.nfid_newfunction='".$obj->nfid."' order by nfc.nf_datecomment desc";
		$rs=mysql_query($sql);
		if(count($rs)>0){
			?>
			<table width="100%" >
				<?php 
				$cvitri=0;
				while($r=mysql_fetch_array($rs)){
					?>
					<tr style="background: <?php if(++$cvitri%2==0) echo '#f2f9ff'; else echo '#ffffff';?>; font-size: 13px;">
						<td class="rf-dt-c" style="padding: 0; vertical-align: middle; width: auto;">
						<span style="font-size: 13px;"><?=(' + '.stripslashes($r['nf_contentcomment']))?></span>
						<i style="color:#424242; display:block; text-align:right; padding-top:5px;padding-right:15px; font-size: 13px;"><?php echo $r['nf_employee_name']." (".$r['nf_datecomment'].")"?></i>
						</td>
					</tr>
					<?php 
				}
				?>
			</table>
			<?php 	
		}
		mysql_close($connection);
	}
}
?>